package com.es.controller;

import com.es.entity.Student;
import com.es.service.StudentService;

import java.util.List;

public class StudentController {
    //
    private StudentService service;

    public void save(){
        Student student = new Student();
        student.setId(null);
        student.setName("董昊");
        int i = service.save(student);
    }

    public void update(){
        Student student = new Student();
        student.setId(1);
        student.setName("马芳园");
        int i = service.update(student);
    }

    public void delete(){

        int i = service.delete(4);
    }

    public Student get(Integer id) {
        return service.get(id);
    }

    public List<Student> list(){
        return service.list();
    }


    public StudentService getService() {
        return service;
    }

    public void setService(StudentService service) {
        this.service = service;
    }
}
